/**
 * 
 */
package il.ac.technion.wiki.impl.search;


import il.ac.technion.wiki.api.search.IScorePolicy;

import il.ac.technion.wiki.api.wikidocument.IWikiDocument;

import il.ac.technion.wiki.api.wikidocument.WikiDocument;

import org.junit.Assert;
import org.junit.Test;

/**
 * @author moshemal
 *
 */
public class MyScorePolicyTest {

	/**
	 * Test method for {@link il.ac.technion.wiki.impl.search.WikiScorePolicy#MyScorePolicy()}.
	 */
	
	@Test
	public void testScoreDoc1(){
		String title 	= "a a	b";
		String content	= "a a b c dffv";
		IWikiDocument wikiDoc = new WikiDocument(title, content);
		IScorePolicy sp = new WikiScorePolicy();
		long result = sp.scoreDoc(wikiDoc, "a", new WikiNeutralWordsCleaner());
		Assert.assertEquals(0,result);
		
		result = sp.scoreDoc(wikiDoc, "b", new WikiNeutralWordsCleaner());
		Assert.assertEquals(6,result);
		
		result = sp.scoreDoc(wikiDoc, "dffv", new WikiNeutralWordsCleaner());
		Assert.assertEquals(1,result);
		
		result = sp.scoreDoc(wikiDoc, "a a	b", new WikiNeutralWordsCleaner());
		Assert.assertEquals(11,result);
		
	}
	
	@Test
	public void testScoreDoc2(){
		String title 	= "a";
		String content	= "a a b c dffv";
		IWikiDocument wikiDoc = new WikiDocument(title, content);
		IScorePolicy sp = new WikiScorePolicy();
		long result = sp.scoreDoc(wikiDoc, "a", new WikiNeutralWordsCleaner());
		System.out.print(result);
		Assert.assertEquals(10,result);
	}
}
